const HDWalletProvider = require('@truffle/hdwallet-provider');
module.exports = {
    // 编译后输出到前端目录，方便前端调用
    contracts_build_directory: './web/src/contracts',
    networks: {
        develop: {
            host: '127.0.0.1',
            port: 9545,
            // 使用metamask连接127.0.0.1本地网络时，metamask要求为1337，所以指定为1337
            network_id: 1337,
        },
        bsctest: {
            // 助记词对应的账号必须有BNB
            provider: () =>
                new HDWalletProvider(
                    `hockey veteran apart trigger mutual deer poet inside stuff inhale machine satoshi`,
                    `https://data-seed-prebsc-1-s1.bnbchain.org:8545/`
                ),
            // 币安测试网ID
            network_id: 97,
            // 这个gasPrice需要根据部署的网络适当调整，5000000000换算后为5Gwei
            // 假设要部署到ETH主网就远远不够
            gasPrice: 5000000000,
            confirmations: 1,
            timeoutBlocks: 200,
            skipDryRun: true,
        },
    },
    compilers: {
        solc: {
            version: '0.8.24',
        },
    },
    plugins: ['truffle-plugin-verify'],
    api_keys: {
        // 币安区块浏览器API
        testnet_bscscan: `WRIA3TSVFBPXHTNHYH8D8KKX4HAFVHPDV8`,
    },
};
